<template>
  <div class="wrap-home">
    <div class="nav">
      <el-button
        type="primary"
        size="mini"
        @click="addModel"
      >新增字典模型</el-button>
    </div>

    <div class="wrap-home-mian">
      <div class="home-item">
          <homeDictionary @item="handleTtem"></homeDictionary>
      </div>
      <div class="home-item">
        <homeDetail></homeDetail>
      </div>
    </div>
    <!-- 新建模型 -->
    <newModelDialog :isNewModelDialog.sync="isNewModelDialog" v-if="isNewModelDialog"></newModelDialog>
  </div>
</template>

<script>
import newModelDialog from "./newModelDialog";
import homeDictionary from './homeDictionary'
import homeDetail from './homeDetail'
export default {
  name: "Home",
  data() {
    return {
      isNewModelDialog: false,
    };
  },
  components: {
    newModelDialog,
    homeDictionary,
    homeDetail
  },
  methods: {
    addModel() {
      this.isNewModelDialog = true;
    },
    // 点击某一项
    handleTtem(item){
      console.log(item)
    } 
  },
};
</script>

<style lang="scss">
.wrap-home {
  .nav {
    margin: 10px;
  }
  .wrap-home-mian {
    margin: 10px;
    height: calc(100vh - 60px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-column-gap: 10px;
    .home-item {
      border: 1px solid rgba($color: #000000, $alpha: 0.1);
      box-shadow: 2px 2px 10px rgba($color: #000000, $alpha: 0.2);
    }
  }
}
</style>
